package com.suian.spring.config;

import com.suian.spring.entity.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration
public class MyConfig {

    @Bean
    @Scope("prototype")
    //通过方法注册一个bean,这里的返回值就是bean的类型，方法名就是bean的id
    public User user() {
        return new User();
    }
}
